// 一.将下面的异步代码使用Promise的方式改进
setTimeout(function () {
  var a = 'hello'
  setTimeout(function () {
    var b = 'lagou'
    setTimeout(function () {
      var c = 'I ❤ U'
      console.log(a + b + c)
    }, 10)
  }, 10)
}, 10)

function delay (string) {
  return new Promise(function (resolve, reject) {
    setTimeout(function () {
      resolve(string)
    }, 10)
  })
}
let string = ''
delay('hello').then(function (value) {
  string += value
})
delay('lagou').then(function (value) {
  string += value
})
delay('I ❤ U').then(function (value) {
  string += value
  console.log(string)
})